package com.sky.sd.system.feign;

import com.sky.sd.common.web.response.Result;
import com.sky.sd.system.bean.dto.LoginUser;
import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.Map;

/**
 * <br/>功能:
 * <br/>版本: 1.0
 * <br/>开发人员: 弓振
 * <br/>创建日期: 2020/6/24 15:13
 * <br/>修改日期: 2020/6/24 15:13
 * <br/>修改列表:
 */
@Component
@Slf4j
public class SysClientFallbackFactory implements FallbackFactory<ISysClient> {

    @Override
    public ISysClient create(Throwable throwable) {
        return new ISysClient() {

            @Override
            public Result<LoginUser> getLoginUser(String username) {
                log.info(" ==> 获取登录用户{}信息失败:{}",username,throwable.getMessage());
                return Result.success(null);
            }
        };
    }
}
